473,423 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,423 software developers and data experts.

Javascript OnMouseOver Event not executing function inside it...

Hi everybody,

I am confused and still looking why this codes is not working. Can anyone notice or know why this code is not working? Thanks in advance.

Code working:
Expand|Select|Wrap|Line Numbers
  1. <form id="form1" runat="server">
  2.     <div>
  3.         &nbsp;</div>
  4.     <div>
  5.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  6.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  7.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  8.             <img src="images/rock.jpg" id="Img3" onmouseover="this.style.cursor='w-resize" /><br /><br />  <<--- working ok
  9.             <input id="Button3" type="button" value="button" /><br />            
  10.         </asp:Panel>  
  11.         ....  
  12. </form>
  13.  
Code Not working:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage()
  4.          {
  5.             document.getElementById('Img3').style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10. <form id="form1" runat="server">
  11.     <div>
  12.         &nbsp;</div>
  13.     <div>
  14.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  15.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  16.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  17.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage()" /><br /><br />  <<--- not working ok
  18.             <input id="Button3" type="button" value="button" /><br />            
  19.         </asp:Panel>  
  20.         ....  
  21. </form>
  22.  
or

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage(obj)
  4.          {
  5.             obj.style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10. <form id="form1" runat="server">
  11.     <div>
  12.         &nbsp;</div>
  13.     <div>
  14.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  15.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  16.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  17.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage(this)" /><br /><br />  <<--- not working ok
  18.             <input id="Button3" type="button" value="button" /><br />            
  19.         </asp:Panel>  
  20.         ....  
  21. </form>
  22.  
or

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage(var obj)
  4.          {
  5.             obj.style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10. <form id="form1" runat="server">
  11.     <div>
  12.         &nbsp;</div>
  13.     <div>
  14.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  15.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  16.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  17.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage(this)" /><br /><br />  <<--- not working ok
  18.             <input id="Button3" type="button" value="button" /><br />            
  19.         </asp:Panel>  
  20.         ....  
  21. </form>
  22.  
or

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">         
  2.     ...         
  3.          function mouseOverImage()
  4.          {
  5.             document.body.style.cursor = "w-resize";
  6.          }
  7.         ...
  8. </script>
  9.  
  10.  
  11. <form id="form1" runat="server">
  12.     <div>
  13.         &nbsp;</div>
  14.     <div>
  15.         <asp:Panel ID="Panel1" runat="server" Height="120px" Width="700px">            
  16.             <input id="Text1" type="text" onmouseover="mouseHover('Text1')" /><br />
  17.             <textarea id="TextArea1" cols="20" rows="2" onmouseover="mouseHover('TextArea1')"></textarea><br />
  18.             <img src="images/rock.jpg" id="Img3" onmouseover="mouseOverImage()" /><br /><br />  <<--- not working ok
  19.             <input id="Button3" type="button" value="button" /><br />            
  20.         </asp:Panel>  
  21.         ....  
  22. </form>
  23.  

den2005
Jul 11 '06 #1
1 18825
This problem has been resolved. Working on drag effect of resizing controls.


den2005
Jul 13 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is...
15
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a "Module not found" error. This PEP aims to fix that...
21
by: ryanmhuc | last post by:
I know the subject might be confusing. I am no beginner with javascript but I haven't been able to figure out how to get the javascript file name from code inside the file. So you have an HTML...
6
by: wimvan | last post by:
Hi, I'm a nerd in javascript, but, after trying and retrying I'm addressing me to help. I have a page with three frames, a top-, a left- and a right-frame. a kind a title-frmae, a button-frame...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
1
by: georgewbaba | last post by:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <script type="text/javascript"> function addpath(obj ,vari){ ...
6
by: Nathan Sokalski | last post by:
I have a DataList which contains several LinkButtons, which are used to select a category in my application. I want the currently selected category to use a different CSS class. Here is an example...
2
by: RobertTheProgrammer | last post by:
Hi, On an ASP.NET GridView, I have several LinkButton objects. I want to add the "onmouseover" event to the LinkButton so that I can perform a javascript task-- in particular, to rewrite the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.